<?php
header("content-type:text/html;charset=utf-8");
$sername="localhost";
$user="root";
$password="123123";
$dbname="xbs_bbs";
try{
    $conn=new PDO("mysql:host=$sername;dbname=$dbname;charset=utf8",$user,$password);

    $sql="insert into stus3(name,age) values('小e','23')";
    $b=$conn->exec($sql);
    if($conn->errorCode()){
        print_r($conn->errorInfo());
    }

}catch (PDOException $e){
    echo $e->getMessage();

}
